package com.lzp.controller;

import com.lzp.entity.Shoe;
import com.lzp.service.IShoeService;
import com.lzp.util.PageResult;
import com.lzp.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lzp
 * @since 2025-01-13
 */
@Controller
@RequestMapping("/shoes")
public class ShoeController {

    @Autowired
    private IShoeService shoeService;

    @GetMapping
    public List<Shoe> getAllShoes(){
        return shoeService.list();
    }

    @GetMapping("/{id}")
    public Shoe getShoeById(@PathVariable Integer id){
        return shoeService.getById(id);
    }

}

























